package predicate;

import java.util.HashMap;

public class Lecture {

	/** 
	 * Variable.
	 */
	private String lectureName;
	private Instructor lectureInstructor;
	private Long lectureLength;
	private Course lectureCourse;
	private HashMap<String, Student> listStudent;
	private Session lectureSession;

	/** 
	 * Class constructor.
	 */
	public Lecture()
	{
		lectureName = "unknow";
		setLectureInstructor(new Instructor("unknown"));
		lectureCourse = null;
		lectureLength = (long) 1;
		listStudent = new HashMap<String, Student>();
	}


	public Lecture(Course course, String lec) {
		lectureCourse = course;
		lectureName = lec;
		lectureLength = (long) 1;
		setLectureInstructor(new Instructor("I" + course.getName() + lec));
		listStudent = new HashMap<String, Student>();
	}

	public Lecture(Course course, String lec, Instructor instructor,
			Long length) {
		lectureCourse = course;
		lectureName = lec;
		lectureLength = length;
		setLectureInstructor(instructor);
		listStudent = new HashMap<String, Student>();
	}

	public Lecture(Course course, String lec, Instructor instructor) {
		lectureCourse = course;
		lectureName = lec;
		lectureLength = null;
		setLectureInstructor(instructor);
		listStudent = new HashMap<String, Student>();
	}

	public Lecture(Course course, String lec, Long hours) {
		lectureCourse = course;
		lectureName = lec;
		lectureLength = hours;
		setLectureInstructor(new Instructor("I" + course.getName() + lec));
		listStudent = new HashMap<String, Student>();
	}

	/**
	 * Assessor
	 * @return lectureName
	 */
	public String getName()
	{
		return lectureName;
	}

	/**
	 * Assessor
	 * @return lectureLength
	 */
	public Long getLength()
	{
		return lectureLength;
	}

	/**
	 * Mutator
	 * @param _lectureName a <code>String</code>
	 */
	public void setName( String _lectureName)
	{
		lectureName = _lectureName;
	}

	/**
	 * Mutator
	 * @param _lectureLength a <code>int</code>
	 */
	public void setLength( Long _lectureLength)
	{
		lectureLength = _lectureLength;
	}

	public Course getCourse() {
		return lectureCourse;
	}

	public void setCourse(Course course) {
		this.lectureCourse = course;
	}

	public void addStudent(Student student) {
		listStudent.put(student.getName(), student);
	}
	
	public HashMap<String, Student> getListStudent()
	{
		return listStudent;
	}
	
	public void setSession(Session session) {
		setLectureSession(session);
	}


	public Instructor getLectureInstructor() {
		return lectureInstructor;
	}


	public void setLectureInstructor(Instructor lectureInstructor) {
		this.lectureInstructor = lectureInstructor;
	}


	public Session getLectureSession() {
		return lectureSession;
	}


	public void setLectureSession(Session lectureSession) {
		this.lectureSession = lectureSession;
	}
}